<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .border{
      width: 100%;
      height: 1px;
      background-color: red;
    }
    .box1{
      height: 38px;
      width: 100%;
      box-shadow: 0 1px 0 0  #000;
    }
    .box2{
      height: 1px;
      width: 100%;
      background-color: red;
    }
    .box3::after{
     content: '';
     height: 1px;
     width: 100%;
     display: block;
     background-color: #000;
    }

    hr {
    height: 1px;
    border-width: 0;
    color: #000;
    background-color: #000;
}
  </style>
</head>
<body>
  <!-- [css] 不使用border画出1px高的线，在不同浏览器的标准和怪异模式下都能保持效果一样 -->

  <div class="border"></div>

  <div class="box1">
    <br>
    box-shadow
  </div>

  <br>

  <div class="box2"></div>
  <br>

  <div class="box3"></div>

  <hr>
</body>
</html>